home *** CD-ROM | disk | FTP | other *** search
/ Programming Languages Suite / ProgramD2.iso / Borland / Borland C++ V5.02 / MSGLINC.PAK / GLAUX.H < prev    next >
C/C++ Source or Header  |  1997-05-06  |  12KB  |  373 lines

  1. /*++ BUILD Version: 0004    // Increment this if a change has global effects
  2.  
  3. Module Name:
  4.  
  5.     glaux.h
  6.  
  7. Abstract:
  8.  
  9.     Procedure declarations, constant definitions and macros for the OpenGL
  10.     Auxiliary Library.
  11.  
  12. --*/
  13.  
  14. /*
  15.  *      C/C++ Run Time Library - Version 8.0
  16.  *
  17.  *      Copyright (c) 1994, 1997 by Borland International
  18.  *      All Rights Reserved.
  19.  *
  20.  */
  21.  
  22. #ifndef __GLAUX_H__
  23. #define __GLAUX_H__
  24. #define __GLAUX_H
  25. #pragma option -b
  26.  
  27. /*
  28.  * (c) Copyright 1993, Silicon Graphics, Inc.
  29.  * ALL RIGHTS RESERVED 
  30.  * Permission to use, copy, modify, and distribute this software for 
  31.  * any purpose and without fee is hereby granted, provided that the above
  32.  * copyright notice appear in all copies and that both the copyright notice
  33.  * and this permission notice appear in supporting documentation, and that 
  34.  * the name of Silicon Graphics, Inc. not be used in advertising
  35.  * or publicity pertaining to distribution of the software without specific,
  36.  * written prior permission. 
  37.  *
  38.  * THE MATERIAL EMBODIED ON THIS SOFTWARE IS PROVIDED TO YOU "AS-IS"
  39.  * AND WITHOUT WARRANTY OF ANY KIND, EXPRESS, IMPLIED OR OTHERWISE,
  40.  * INCLUDING WITHOUT LIMITATION, ANY WARRANTY OF MERCHANTABILITY OR
  41.  * FITNESS FOR A PARTICULAR PURPOSE.  IN NO EVENT SHALL SILICON
  42.  * GRAPHICS, INC.  BE LIABLE TO YOU OR ANYONE ELSE FOR ANY DIRECT,
  43.  * SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY
  44.  * KIND, OR ANY DAMAGES WHATSOEVER, INCLUDING WITHOUT LIMITATION,
  45.  * LOSS OF PROFIT, LOSS OF USE, SAVINGS OR REVENUE, OR THE CLAIMS OF
  46.  * THIRD PARTIES, WHETHER OR NOT SILICON GRAPHICS, INC.  HAS BEEN
  47.  * ADVISED OF THE POSSIBILITY OF SUCH LOSS, HOWEVER CAUSED AND ON
  48.  * ANY THEORY OF LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE
  49.  * POSSESSION, USE OR PERFORMANCE OF THIS SOFTWARE.
  50.  * 
  51.  * US Government Users Restricted Rights 
  52.  * Use, duplication, or disclosure by the Government is subject to
  53.  * restrictions set forth in FAR 52.227.19(c)(2) or subparagraph
  54.  * (c)(1)(ii) of the Rights in Technical Data and Computer Software
  55.  * clause at DFARS 252.227-7013 and/or in similar or successor
  56.  * clauses in the FAR or the DOD or NASA FAR Supplement.
  57.  * Unpublished-- rights reserved under the copyright laws of the
  58.  * United States.  Contractor/manufacturer is Silicon Graphics,
  59.  * Inc., 2011 N.  Shoreline Blvd., Mountain View, CA 94039-7311.
  60.  *
  61.  * OpenGL(TM) is a trademark of Silicon Graphics, Inc.
  62.  */
  63.  
  64. #pragma option -b.
  65. #include <windows.h>
  66. #pragma option -b
  67. #pragma option -b.
  68. #include <GL/gl.h>
  69. #pragma option -b
  70. #pragma option -b.
  71. #include <GL/glu.h>
  72. #pragma option -b
  73.  
  74. #ifdef __cplusplus
  75. extern "C" {
  76. #endif
  77.  
  78. /*
  79. ** ToolKit Window Types
  80. ** In the future, AUX_RGBA may be a combination of both RGB and ALPHA
  81. */
  82.  
  83. #define AUX_RGB             0
  84. #define AUX_RGBA            AUX_RGB
  85. #define AUX_INDEX           1
  86. #define AUX_SINGLE          0
  87. #define AUX_DOUBLE          2
  88. #define AUX_DIRECT          0
  89. #define AUX_INDIRECT        4
  90.  
  91. #define AUX_ACCUM           8
  92. #define AUX_ALPHA           16
  93. #define AUX_DEPTH           32      /* 32-bit depth buffer */
  94. #define AUX_STENCIL         64
  95. #define AUX_AUX             128
  96. #define AUX_DEPTH16         256     /* 16-bit depth buffer */
  97. #define AUX_FIXED_332_PAL   512
  98.  
  99. /* 
  100. ** Window Masks
  101. */
  102.  
  103. #define AUX_WIND_IS_RGB(x)      (((x) & AUX_INDEX) == 0)
  104. #define AUX_WIND_IS_INDEX(x)    (((x) & AUX_INDEX) != 0)
  105. #define AUX_WIND_IS_SINGLE(x)   (((x) & AUX_DOUBLE) == 0)
  106. #define AUX_WIND_IS_DOUBLE(x)   (((x) & AUX_DOUBLE) != 0)
  107. #define AUX_WIND_IS_INDIRECT(x) (((x) & AUX_INDIRECT) != 0)
  108. #define AUX_WIND_IS_DIRECT(x)   (((x) & AUX_INDIRECT) == 0)
  109. #define AUX_WIND_HAS_ACCUM(x)   (((x) & AUX_ACCUM) != 0)
  110. #define AUX_WIND_HAS_ALPHA(x)   (((x) & AUX_ALPHA) != 0)
  111. #define AUX_WIND_HAS_DEPTH(x)   (((x) & (AUX_DEPTH | AUX_DEPTH16)) != 0)
  112. #define AUX_WIND_HAS_STENCIL(x) (((x) & AUX_STENCIL) != 0)
  113. #define AUX_WIND_USES_FIXED_332_PAL(x)  (((x) & AUX_FIXED_332_PAL) != 0)
  114.  
  115. /*
  116. ** ToolKit Event Structure
  117. */
  118.  
  119. typedef struct _AUX_EVENTREC {
  120.     GLint event;
  121.     GLint data[4];
  122. } AUX_EVENTREC;
  123.  
  124. /* 
  125. ** ToolKit Event Types
  126. */
  127. #define AUX_EXPOSE      1
  128. #define AUX_CONFIG      2
  129. #define AUX_DRAW        4
  130. #define AUX_KEYEVENT    8
  131. #define AUX_MOUSEDOWN   16
  132. #define AUX_MOUSEUP     32
  133. #define AUX_MOUSELOC    64
  134.  
  135. /*
  136. ** Toolkit Event Data Indices
  137. */
  138. #define AUX_WINDOWX             0
  139. #define AUX_WINDOWY             1
  140. #define AUX_MOUSEX              0
  141. #define AUX_MOUSEY              1
  142. #define AUX_MOUSESTATUS         3
  143. #define AUX_KEY                 0
  144. #define AUX_KEYSTATUS           1
  145.  
  146. /*
  147. ** ToolKit Event Status Messages
  148. */
  149. #define AUX_LEFTBUTTON          1
  150. #define AUX_RIGHTBUTTON         2
  151. #define AUX_MIDDLEBUTTON        4
  152. #define AUX_SHIFT               1
  153. #define AUX_CONTROL             2
  154.  
  155. /* 
  156. ** ToolKit Key Codes
  157. */
  158. #define AUX_RETURN              0x0D
  159. #define AUX_ESCAPE              0x1B
  160. #define AUX_SPACE               0x20
  161. #define AUX_LEFT                0x25
  162. #define AUX_UP                  0x26
  163. #define AUX_RIGHT               0x27
  164. #define AUX_DOWN                0x28
  165. #define AUX_A                   'A'
  166. #define AUX_B                   'B'
  167. #define AUX_C                   'C'
  168. #define AUX_D                   'D'
  169. #define AUX_E                   'E'
  170. #define AUX_F                   'F'
  171. #define AUX_G                   'G'
  172. #define AUX_H                   'H'
  173. #define AUX_I                   'I'
  174. #define AUX_J                   'J'
  175. #define AUX_K                   'K'
  176. #define AUX_L                   'L'
  177. #define AUX_M                   'M'
  178. #define AUX_N                   'N'
  179. #define AUX_O                   'O'
  180. #define AUX_P                   'P'
  181. #define AUX_Q                   'Q'
  182. #define AUX_R                   'R'
  183. #define AUX_S                   'S'
  184. #define AUX_T                   'T'
  185. #define AUX_U                   'U'
  186. #define AUX_V                   'V'
  187. #define AUX_W                   'W'
  188. #define AUX_X                   'X'
  189. #define AUX_Y                   'Y'
  190. #define AUX_Z                   'Z'
  191. #define AUX_a                   'a'
  192. #define AUX_b                   'b'
  193. #define AUX_c                   'c'
  194. #define AUX_d                   'd'
  195. #define AUX_e                   'e'
  196. #define AUX_f                   'f'
  197. #define AUX_g                   'g'
  198. #define AUX_h                   'h'
  199. #define AUX_i                   'i'
  200. #define AUX_j                   'j'
  201. #define AUX_k                   'k'
  202. #define AUX_l                   'l'
  203. #define AUX_m                   'm'
  204. #define AUX_n                   'n'
  205. #define AUX_o                   'o'
  206. #define AUX_p                   'p'
  207. #define AUX_q                   'q'
  208. #define AUX_r                   'r'
  209. #define AUX_s                   's'
  210. #define AUX_t                   't'
  211. #define AUX_u                   'u'
  212. #define AUX_v                   'v'
  213. #define AUX_w                   'w'
  214. #define AUX_x                   'x'
  215. #define AUX_y                   'y'
  216. #define AUX_z                   'z'
  217. #define AUX_0                   '0'
  218. #define AUX_1                   '1'
  219. #define AUX_2                   '2'
  220. #define AUX_3                   '3'
  221. #define AUX_4                   '4'
  222. #define AUX_5                   '5'
  223. #define AUX_6                   '6'
  224. #define AUX_7                   '7'
  225. #define AUX_8                   '8'
  226. #define AUX_9                   '9'
  227.  
  228. /*
  229. ** ToolKit Gets and Sets
  230. */
  231. #define AUX_FD                  1  /* return fd (long) */
  232. #define AUX_COLORMAP            3  /* pass buf of r, g and b (unsigned char) */
  233. #define AUX_GREYSCALEMAP        4
  234. #define AUX_FOGMAP              5  /* pass fog and color bits (long) */
  235. #define AUX_ONECOLOR            6  /* pass index, r, g, and b (long) */
  236.  
  237. /*
  238. ** Color Macros
  239. */
  240.  
  241. #define AUX_BLACK               0
  242. #define AUX_RED                 13
  243. #define AUX_GREEN               14
  244. #define AUX_YELLOW              15
  245. #define AUX_BLUE                16
  246. #define AUX_MAGENTA             17
  247. #define AUX_CYAN                18
  248. #define AUX_WHITE               19
  249.  
  250. extern float auxRGBMap[20][3];
  251.  
  252. #define AUX_SETCOLOR(x, y) (AUX_WIND_IS_RGB((x)) ? \
  253.                            glColor3fv(auxRGBMap[(y)]) : glIndexf((y)))
  254.  
  255. /*
  256. ** RGB Image Structure
  257. */
  258.  
  259. typedef struct _AUX_RGBImageRec {
  260.     GLint sizeX, sizeY;
  261.     unsigned char *data;
  262. } AUX_RGBImageRec;
  263.  
  264. /*
  265. ** Prototypes
  266. */
  267.  
  268. void APIENTRY auxInitDisplayMode(GLenum);
  269. void APIENTRY auxInitPosition(int, int, int, int);
  270.  
  271. /* GLenum APIENTRY auxInitWindow(LPCTSTR); */
  272. #ifdef UNICODE
  273. #define auxInitWindow auxInitWindowW
  274. #else
  275. #define auxInitWindow auxInitWindowA
  276. #endif
  277. GLenum APIENTRY auxInitWindowA(LPCSTR);
  278. GLenum APIENTRY auxInitWindowW(LPCWSTR);
  279.  
  280. void APIENTRY auxCloseWindow(void);
  281. void APIENTRY auxQuit(void);
  282. void APIENTRY auxSwapBuffers(void);
  283.  
  284. typedef void (CALLBACK* AUXMAINPROC)(void);
  285. void APIENTRY auxMainLoop(AUXMAINPROC);
  286.  
  287. typedef void (CALLBACK* AUXEXPOSEPROC)(int, int);
  288. void APIENTRY auxExposeFunc(AUXEXPOSEPROC);
  289.  
  290. typedef void (CALLBACK* AUXRESHAPEPROC)(GLsizei, GLsizei);
  291. void APIENTRY auxReshapeFunc(AUXRESHAPEPROC);
  292.  
  293. typedef void (CALLBACK* AUXIDLEPROC)(void);
  294. void APIENTRY auxIdleFunc(AUXIDLEPROC);
  295.  
  296. typedef void (CALLBACK* AUXKEYPROC)(void);
  297. void APIENTRY auxKeyFunc(int, AUXKEYPROC);
  298.  
  299. typedef void (CALLBACK* AUXMOUSEPROC)(AUX_EVENTREC *);
  300. void APIENTRY auxMouseFunc(int, int, AUXMOUSEPROC);
  301.  
  302. int  APIENTRY auxGetColorMapSize(void);
  303. void APIENTRY auxGetMouseLoc(int *, int *);
  304. void APIENTRY auxSetOneColor(int, float, float, float);
  305. void APIENTRY auxSetFogRamp(int, int);
  306. void APIENTRY auxSetGreyRamp(void);
  307. void APIENTRY auxSetRGBMap(int, float *);
  308.  
  309. /* AUX_RGBImageRec * APIENTRY auxRGBImageLoad(LPCTSTR); */
  310. #ifdef UNICODE
  311. #define auxRGBImageLoad auxRGBImageLoadW
  312. #else
  313. #define auxRGBImageLoad auxRGBImageLoadA
  314. #endif
  315. AUX_RGBImageRec * APIENTRY auxRGBImageLoadA(LPCSTR);
  316. AUX_RGBImageRec * APIENTRY auxRGBImageLoadW(LPCWSTR);
  317.  
  318. #ifdef UNICODE
  319. #define auxDIBImageLoad auxDIBImageLoadW
  320. #else
  321. #define auxDIBImageLoad auxDIBImageLoadA
  322. #endif
  323. AUX_RGBImageRec * APIENTRY auxDIBImageLoadA(LPCSTR);
  324. AUX_RGBImageRec * APIENTRY auxDIBImageLoadW(LPCWSTR);
  325.  
  326. void APIENTRY auxCreateFont(void);
  327. /* void APIENTRY auxDrawStr(LPCTSTR); */
  328. #ifdef UNICODE
  329. #define auxDrawStr auxDrawStrW
  330. #else
  331. #define auxDrawStr auxDrawStrA
  332. #endif
  333. void APIENTRY auxDrawStrA(LPCSTR);
  334. void APIENTRY auxDrawStrW(LPCWSTR);
  335.  
  336. void APIENTRY auxWireSphere(GLdouble);
  337. void APIENTRY auxSolidSphere(GLdouble);
  338. void APIENTRY auxWireCube(GLdouble);
  339. void APIENTRY auxSolidCube(GLdouble);
  340. void APIENTRY auxWireBox(GLdouble, GLdouble, GLdouble);
  341. void APIENTRY auxSolidBox(GLdouble, GLdouble, GLdouble);
  342. void APIENTRY auxWireTorus(GLdouble, GLdouble);
  343. void APIENTRY auxSolidTorus(GLdouble, GLdouble);
  344. void APIENTRY auxWireCylinder(GLdouble, GLdouble);
  345. void APIENTRY auxSolidCylinder(GLdouble, GLdouble);
  346. void APIENTRY auxWireIcosahedron(GLdouble);
  347. void APIENTRY auxSolidIcosahedron(GLdouble);
  348. void APIENTRY auxWireOctahedron(GLdouble);
  349. void APIENTRY auxSolidOctahedron(GLdouble);
  350. void APIENTRY auxWireTetrahedron(GLdouble);
  351. void APIENTRY auxSolidTetrahedron(GLdouble);
  352. void APIENTRY auxWireDodecahedron(GLdouble);
  353. void APIENTRY auxSolidDodecahedron(GLdouble);
  354. void APIENTRY auxWireCone(GLdouble, GLdouble);
  355. void APIENTRY auxSolidCone(GLdouble, GLdouble);
  356. void APIENTRY auxWireTeapot(GLdouble);
  357. void APIENTRY auxSolidTeapot(GLdouble);
  358.  
  359. /*
  360. ** Window specific functions
  361. ** hwnd, hdc, and hglrc valid after auxInitWindow()
  362. */
  363. HWND  APIENTRY auxGetHWND(void);
  364. HDC   APIENTRY auxGetHDC(void);
  365. HGLRC APIENTRY auxGetHGLRC(void);
  366.  
  367. #ifdef __cplusplus
  368. }
  369. #endif
  370.  
  371. #pragma option -b.
  372. #endif /* __GLAUX_H__ */
  373.